problems with reading a csv file into a pandas data frame

by: whorticulturist, 8 years ago


so I'm trying to get this csv file, that I exported from a phpmyadmin Database, into a pandas data frame, but when I run the code it turns all of my columns into a single column like this :


import pandas as pd

df_SEAL = pd.read_csv('~/Desktop/__SEAL_DATA__-2.csv', sep='delimiter', header=None, engine='python')

print (df_SEAL)


output:

634  "7"'"Wildwood"'"2013-03-12 15:12:57"'"5-2012"'...
635  "8"'"Wildwood"'"2013-03-14 14:58:02"'"4-2012"'...
636  "9"'NULL'"2013-04-24 14:44:11"'NULL'NULL'NULL'...
637  "10"'"David"'"2013-04-25 15:41:54"'" 2012-7"'"...
638  "11"'NULL'"2013-11-14 10:40:38"'NULL'NULL'NULL...

[639 rows x 1 columns]

If you have any suggestions on how I could fix this problem I would be so grateful.



You must be logged in to post. Please login or register an account.



sep='delimiter'  makes no sense.

the sep IS the delimiter (sep = separator, which is a synonym in this case for delimiter)....what splits the values? Is it a comma? a tab? ...etc? THAT is what the sep should be. If your file is truly a csv (comma separated values), then you should have sep=','


-Harrison 8 years ago

You must be logged in to post. Please login or register an account.